function XSLTransformer (FOCS) {   
    var MODE = FOCS;
    		    		
	this.calculate = (MODE)?(
		function(target,xmlparameter,xslparameter,nodes,callback) {
			var processor = new XSLTProcessor();
			var resultDoc,resultString;
            if ($.isFunction(processor.transformDocument)) {
                // Mozilla interface
                resultDoc = document.implementation.createDocument("", "", null);
                processor.transformDocument(xmlparameter.responseXML, xslparameter.responseXML, resultDoc, null);
                resultString = new XMLSerializer().serializeToString(resultDoc);
                target.html(resultString);
                
            }
            else {
                processor.importStylesheet(xslparameter.responseXML);
                resultDoc = processor.transformToFragment(xmlparameter.responseXML, document);
                target.empty().append(resultDoc);
                resultString = target.html();
            }
            var state = {
            	resultDoc:resultString,
            	xmlDoc:xmlparameter.responseXML,
            	xslDoc:xslparameter.responseXML
            };
			callback(state);
			
		}):(
		function(target,xmlparameter,xslparameter,nodes,callback) {

			if (isSettedXMLDocument(nodes.xmlnode)) {
				nodes.xmlnode.load(xmlparameter.responseXML);
			}

			if (isSettedXMLDocument(nodes.xslnode)) {
				nodes.xslnode.load(xslparameter.responseXML);
			}
			
        	var out = nodes.xmlnode.transformNode(nodes.xslnode.XMLDocument);
			target.html(out);
			var state = {
				resultDoc:target.html(),
				xmlDoc:nodes.xmlnode.XMLDocument,
				xslDoc:nodes.xslnode.XMLDocument
		    };
			callback(state);

		});
}